//实现call
function person(a, b, c, d) {
    /*console.log(this.name)
    console.log(a, b, c, d);*/
    return {
        name: this.name,
        a: a, b: b, c: c, d: d
    }
}

var egg = {name: 'jueyi'}

Function.prototype.newCall = function (obj, ...arr) {
    //这里的this指向的是person
    //console.log(this)

    var obj = obj || global;

    obj.p = this;
    let res = obj.p(...arr);

    //不能改变对象
    delete obj.p;
    return res;
};

// let res = person.newCall(egg, "点赞", "收藏", "转发", "关注");
let res = person.newCall(null, "点赞", "收藏", "转发", "关注");
console.log(res);